#ifndef DATA_MINER_H
#define DATA_MINER_H

#include "../apriori/apriori.h"
#include "../model/client.h"
#include "../model/title.h"

#include "title_dataset.h"
#include "title_adapter.h"
#include "file_streamer.h"
#include "../singletone.h"
#include "../model/model_class.h"

#include <boost/shared_ptr.hpp>

#include <list>
#include <iostream>

using namespace std;

namespace handler {
	class data_miner {
	public:
		typedef apriori::apriori_alg<handler::title_dataset, list> 
			my_apriori;
		typedef my_apriori::t_itemset_c::data_ptr data_ptr;

		data_miner(boost::shared_ptr<model::client> clt):_client(clt){}
		~data_miner() {}

		void doit();
		boost::shared_ptr<model::title> get_result() { return _result; }
	private:
		list<boost::shared_ptr<handler::title_adapter> > create_list(
			const list<string> &l);
		list<boost::shared_ptr<handler::title_dataset> > 
			create_datasets(const list<boost::shared_ptr<
						handler::title_adapter> > &l);

		boost::shared_ptr<model::client> _client;
		boost::shared_ptr<model::title> _result;
	};
}

#endif
